package GUI.Cocina;

import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

public class OrdenLista extends Dialog {

	protected Object result;
	protected Shell shell;
	String mensaje;
	/**
	 * Create the dialog.
	 * @param parent
	 * @param style
	 */
	public OrdenLista(Shell parent, int style, String m) {
		super(parent, style);
		mensaje=m;
		setText("ORDEN LISTA");
	}

	/**
	 * Open the dialog.
	 * @return the result
	 */
	public Object open() {
		createContents();
		shell.open();
		shell.layout();
		Display display = getParent().getDisplay();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	private void createContents() {
		shell = new Shell(getParent(), getStyle());
		shell.setSize(450, 185);
		shell.setText(getText());
		
		Label label_1 = new Label(shell, SWT.NONE);
		label_1.setBounds(48, 85, 353, 14);
		
		Label lblNewLabel = new Label(shell, SWT.NONE);
		lblNewLabel.setBounds(49, 68, 59, 14);
		lblNewLabel.setText("LA ORDEN DE LA" + mensaje + " ESTA LISTA" );
		
		Button btnNewButton = new Button(shell, SWT.NONE);
		btnNewButton.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				shell.dispose();
			}
		});
		btnNewButton.setBounds(178, 105, 94, 28);
		btnNewButton.setText("ACEPTAR");

	}

}
